package king.dominic.jlibrary.util;

import android.util.Log;

/**
 * Created by king on 2017/1/22.
 * LogUtil
 */

public class LogUtil {
    private static  boolean DEBUG = true;
    public static void init(boolean debug){
        DEBUG=debug;
    }
    public static void i(String TAG, String message) {
        if (DEBUG)
            Log.i(TAG, message);
    }

    public static void w(String TAG, String message) {
        if (DEBUG)
            Log.w(TAG, message);
    }

    public static void w(String TAG, String message, Throwable tr) {
        if (DEBUG)
            Log.w(TAG, message, tr);
    }

    public static void d(String TAG, String message) {
        if (DEBUG)
            Log.d(TAG, message);
    }

    public static void e(String TAG, String message) {
        if (DEBUG)
            Log.e(TAG, message);
    }

    public static void e(String TAG, String message, Throwable tr) {
        if (DEBUG)
            Log.e(TAG, message, tr);
    }
}
